dnl When bumping the gio-unix-2.0 dependency (or glib-2.0 in general),
dnl remember to bump GLIB_VERSION_MIN_REQUIRED and
dnl GLIB_VERSION_MAX_ALLOWED in Makefile.am
-GIO_DEPENDENCY="gio-unix-2.0 >= 2.40.0 libgsystem >= 2015.1"
+GIO_DEPENDENCY="gio-unix-2.0 >= 2.40.0"
PKG_CHECK_MODULES(OT_DEP_GIO_UNIX, $GIO_DEPENDENCY)
dnl 5.1.0 is an arbitrary version here
-Subproject commit 871617d51984604e28483d959e37fd6ce4524b0e
+Subproject commit 4ae5e3beaaa674abfabf7404ab6fafcc4ec547db
# Core requirements
BuildRequires: pkgconfig(gio-unix-2.0)
BuildRequires: pkgconfig(libsoup-2.4)
-BuildRequires: pkgconfig(libgsystem)
BuildRequires: pkgconfig(e2p)
# Extras
BuildRequires: pkgconfig(libarchive)
#include "config.h"
#include "ot-fs-utils.h"
-#include "libgsystem.h"
#include "libglnx.h"
#include <sys/xattr.h>
#include <gio/gunixinputstream.h>
}
#endif
+
+G_LOCK_DEFINE_STATIC (pathname_cache);
+
+/**
+ * ot_file_get_path_cached:
+ *
+ * Like g_file_get_path(), but returns a constant copy so callers
+ * don't need to free the result.
+ */
+const char *
+ot_file_get_path_cached (GFile *file)
+{
+ const char *path;
+ static GQuark _file_path_quark = 0;
+
+ if (G_UNLIKELY (_file_path_quark) == 0)
+ _file_path_quark = g_quark_from_static_string ("gsystem-file-path");
+
+ G_LOCK (pathname_cache);
+
+ path = g_object_get_qdata ((GObject*)file, _file_path_quark);
+ if (!path)
+ {
+ path = g_file_get_path (file);
+ if (path == NULL)
+ {
+ G_UNLOCK (pathname_cache);
+ return NULL;
+ }
+ g_object_set_qdata_full ((GObject*)file, _file_path_quark, (char*)path, (GDestroyNotify)g_free);
+ }
+
+ G_UNLOCK (pathname_cache);
+
+ return path;
+}
#endif
#define g_file_enumerator_iterate ot_file_enumerator_iterate
+const char *
+ot_file_get_path_cached (GFile *file);
+
+static inline
+const char *
+gs_file_get_path_cached (GFile *file)
+{
+ return ot_file_get_path_cached (file);
+}
+
G_END_DECLS
#pragma once
#include <gio/gio.h>
-#include <libgsystem.h>
#include <string.h> /* Yeah...let's just do that here. */
-#include <gsystem-local-alloc.h>
#include <libglnx.h>
#define ot_gobject_refz(o) (o ? g_object_ref (o) : o)
#include "config.h"
#include "libglnx.h"
+#include "otutil.h"
#include "ot-editor.h"
-#include "libgsystem.h"
#include <sys/wait.h>
#include <string.h>
;;
esac
-case "$ci_suite" in
- (jessie)
- # Add alexl's Debian 8 backport repository to get libgsystem
- # TODO: remove this when libgsystem is no longer needed
- $sudo apt-get -y update
- $sudo apt-get -y install apt-transport-https wget
- wget -O - https://sdk.gnome.org/apt/debian/conf/alexl.gpg.key | $sudo apt-key add -
- echo "deb [arch=amd64] https://sdk.gnome.org/apt/debian/ jessie main" | $sudo tee /etc/apt/sources.list.d/flatpak.list
- ;;
-
- (trusty|xenial)
- # Add alexl's Flatpak PPA, again to get libgsystem
- # TODO: remove this when libgsystem is no longer needed
- $sudo apt-get -y update
- $sudo apt-get -y install software-properties-common
- $sudo add-apt-repository --yes ppa:alexlarsson/flatpak
- ;;
-esac
-
case "$ci_distro" in
(debian|ubuntu)
# TODO: fetch this list from the Debian packaging git repository?
libgirepository1.0-dev \
libglib2.0-dev \
libgpgme11-dev \
- libgsystem-dev \
liblzma-dev \
libmount-dev \
libselinux1-dev \
#include "config.h"
#include "libglnx.h"
-#include "libgsystem.h"
#include <glib.h>
#include <stdlib.h>
#include <gio/gio.h>
#include "config.h"
-#include <libgsystem.h>
#include <gpgme.h>
+#include "libglnx.h"
#include "ostree-gpg-verify-result-private.h"